/*************************************************************
 * File: Order.java
 * Copyright (c) 2012
 * Author: Huang Shaobin
 * Email: Shaobin.Software@gmail.com Shaobin_Software@163.com 
 * Date: Feb 21, 2013
 * Description: 
 ************************************************************/

package snow.core.persistence;

/**
 * 排序类
 * 
 * @author Shaobin.Software@gmail.com Shaobin_Software@163.com 
 * @version 1.0 
 */
public class Order {

	public static Order asc(String propertyName) {
		return new Order(propertyName, true);
	}

	public static Order desc(String propertyName) {
		return new Order(propertyName, false);
	}

	private final boolean ascending;

	private final String propertyName;

	protected Order(String propertyName, boolean ascending) {
		this.propertyName = propertyName;
		this.ascending = ascending;
	}

	public String getPropertyName() {
		return propertyName;
	}

	public boolean isAscending() {
		return ascending;
	}
}
